#!/bin/bash -e

if [[ -e "/usr/lib/librockit.so" ]]; then
    echo "Found librockit.so"
else
    sudo cp lib/librockit.so /usr/lib/librockit.so
fi

# rm rtspstream
if [[ -e "rtspstream" ]]; then
    rm rtspstream
fi

if [[ -e "src/sv2_streamer.o" ]]; then
    rm ./src/*.o
fi

make
mkdir -p build
mv rtspstream ./build/rtspstream
